home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-05-01 | 8.0 KB | 264 lines | [TEXT/MPS ] |
- ;
- ; File: Scrap.a
- ;
- ; Contains: Scrap Manager Interfaces.
- ;
- ; Version: Technology: System 7.5
- ; Release: Universal Interfaces 3.0d3 on Copland DR1
- ;
- ; Copyright: © 1984-1996 by Apple Computer, Inc. All rights reserved.
- ;
- ; Bugs?: If you find a problem with this file, send the file and version
- ; information (from above) and the problem description to:
- ;
- ; Internet: apple.bugs@applelink.apple.com
- ; AppleLink: APPLE.BUGS
- ;
- ;
- IF &TYPE('__SCRAP__') = 'UNDEFINED' THEN
- __SCRAP__ SET 1
-
- IF &TYPE('__TYPES__') = 'UNDEFINED' THEN
- include 'Types.a'
- ENDIF
- IF &TYPE('__FILEMANAGER__') = 'UNDEFINED' THEN
- include 'FileManager.a'
- ENDIF
- ;
- ;_________________________________________________________________________________________________________
- ; • STUCTURES
- ;_________________________________________________________________________________________________________
- ;
-
-
- ; typedef UInt32 ScrapItemUserReference
-
- ; typedef OSType ScrapItemType
-
- IF FOR_SYSTEM8_PREEMPTIVE THEN
- ;
- ;_________________________________________________________________________________________________________
- ; • SCRAP ITEM TYPE ATTRIBUTES
- ;_________________________________________________________________________________________________________
- ;
- ; typedef OptionBits ScrapItemTypeAttributes
-
-
- kScrapItemTypeNoAttributes EQU $00 ; No scrap item type attributes
- kScrapItemTypeSenderOnly EQU $01 ; Scrap item type is available to sender only
- kScrapItemTypeSenderTranslated EQU $02 ; Scrap item type is translated by sender
- kScrapItemTypeNotSaved EQU $04 ; Scrap item type should not be saved
- kScrapItemTypeSystemTranslated EQU $0100 ; Scrap item type is translated by Scrap Manager
- ;
- ;_________________________________________________________________________________________________________
- ; • FSOBJECTREF SCRAP ITEM TYPE
- ;_________________________________________________________________________________________________________
- ;
-
- kScrapItemTypeFSObject EQU 'fsob' ; scrap item type for FSObjectRef data
-
-
- FSObjectScrapItemType RECORD 0
- objectInfo_o ds FSObjectInformation ; offset: $0 (0) ; FSObject information
- object_t ds.l 1 ; offset: $6C (108) ; FSObjectRef - Call FSObjectRefRegister() before using
- sizeof EQU * ; size: $70 (112)
- ENDR
- ;
- ;_________________________________________________________________________________________________________
- ;
- ; • FSOBJECTREF PROMISE SCRAP ITEM TYPE
- ;_________________________________________________________________________________________________________
- ;
-
- kScrapItemTypePromiseFSObject EQU 'pfob' ; Scrap item type for promised FSObjectRef data
-
-
- PromiseFSObjectScrapItemType RECORD 0
- objectInfo_o ds FSObjectInformation ; offset: $0 (0) ; FSObject information
- promisedScrapItemType ds.l 1 ; offset: $6C (108) ; Promised scrap item type containing an FSObjectRef
- sizeof EQU * ; size: $70 (112)
- ENDR
- ;
- ;_________________________________________________________________________________________________________
- ; • CREATING & DELETING SCRAPS
- ;_________________________________________________________________________________________________________
- ;
- ;
- ; extern OSStatus NewScrapRef(ScrapRef *scrapReference)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION NewScrapRef
- ENDIF
-
- ;
- ; extern OSStatus DisposeScrapRef(ScrapRef scrapReference)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION DisposeScrapRef
- ENDIF
-
- ;
- ;_________________________________________________________________________________________________________
- ; • ADDING SCRAP ITEMS
- ;_________________________________________________________________________________________________________
- ;
- ;
- ; extern OSStatus AddScrapItemType(ScrapRef scrapReference, ScrapItemUserReference newOrExistingUserReference, ScrapItemType newItemType, void *data, ByteCount dataSize)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION AddScrapItemType
- ENDIF
-
- ;
- ; extern OSStatus SetScrapItemTypeData(ScrapRef scrapReference, ScrapItemUserReference existingUserReference, ScrapItemType existingItemType, const void *data, ByteCount dataSize, UInt32 dataOffset)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION SetScrapItemTypeData
- ENDIF
-
- ;
- ; extern OSStatus SetScrapItemTypeAttributes(ScrapRef scrapReference, ScrapItemUserReference existingUserReference, ScrapItemType existingItemType, ScrapItemTypeAttributes attributes)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION SetScrapItemTypeAttributes
- ENDIF
-
- ;
- ; extern OSStatus SetScrapItemTypePromiseHint(ScrapRef scrapReference, ScrapItemUserReference existingUserReference, ScrapItemType existingItemType, UInt32 userPromiseHint)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION SetScrapItemTypePromiseHint
- ENDIF
-
- ;
- ;_________________________________________________________________________________________________________
- ; • GETTING SCRAP ITEM INFORMATION
- ; NOTE: ALL INDEXES ARE 1 BASED (1 .. N)
- ;_________________________________________________________________________________________________________
- ;
- ;
- ; extern OSStatus CountScrapItems(ScrapRef scrapReference, ItemCount *numberScrapItems)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION CountScrapItems
- ENDIF
-
- ;
- ; extern OSStatus GetScrapItem(ScrapRef scrapReference, UInt32 scrapItemIndex, ScrapItemUserReference *userReference)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION GetScrapItem
- ENDIF
-
- ;
- ; extern OSStatus CountScrapItemTypes(ScrapRef scrapReference, ScrapItemUserReference userReference, ItemCount *numberItemTypes)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION CountScrapItemTypes
- ENDIF
-
- ;
- ; extern OSStatus GetScrapItemType(ScrapRef scrapReference, ScrapItemUserReference userReference, UInt32 itemTypeIndex, ScrapItemType *itemType)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION GetScrapItemType
- ENDIF
-
- ;
- ; extern OSStatus GetScrapItemTypeDataSize(ScrapRef scrapReference, ScrapItemUserReference userReference, ScrapItemType itemType, ByteCount *itemTypeDataSize)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION GetScrapItemTypeDataSize
- ENDIF
-
- ;
- ; extern OSStatus GetScrapItemTypeData(ScrapRef scrapReference, ScrapItemUserReference userReference, ScrapItemType itemType, void *data, ByteCount *dataSize, UInt32 *dataOffset)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION GetScrapItemTypeData
- ENDIF
-
- ;
- ; extern OSStatus GetScrapItemTypeAttributes(ScrapRef scrapReference, ScrapItemUserReference userReference, ScrapItemType itemType, ScrapItemTypeAttributes *attributes)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION GetScrapItemTypeAttributes
- ENDIF
-
- ENDIF
- IF FOR_SYSTEM7_AND_SYSTEM8_DEPRECATED THEN
- ;
- ;_________________________________________________________________________________________________________
- ; • CLASSIC SCRAP MANAGER API
- ;_________________________________________________________________________________________________________
- ;
- ScrapStuff RECORD 0
- scrapSize ds.l 1 ; offset: $0 (0)
- scrapHandle ds.l 1 ; offset: $4 (4)
- scrapCount ds.w 1 ; offset: $8 (8)
- scrapState ds.w 1 ; offset: $A (10)
- scrapName ds.l 1 ; offset: $C (12)
- sizeof EQU * ; size: $10 (16)
- ENDR
- ; typedef struct ScrapStuff * PScrapStuff
-
- ; typedef struct ScrapStuff * ScrapStuffPtr
-
- ;
- ; pascal ScrapStuffPtr InfoScrap(void )
- ;
- IF ¬ GENERATINGCFM THEN
- _InfoScrap: OPWORD $A9F9
- ELSE
- IMPORT_CFM_FUNCTION InfoScrap
- ENDIF
-
- ;
- ; pascal SInt32 UnloadScrap(void )
- ;
- IF ¬ GENERATINGCFM THEN
- _UnloadScrap: OPWORD $A9FA
- ELSE
- IMPORT_CFM_FUNCTION UnloadScrap
- ENDIF
-
- ;
- ; pascal SInt32 LoadScrap(void )
- ;
- IF ¬ GENERATINGCFM THEN
- _LoadScrap: OPWORD $A9FB
- ELSE
- IMPORT_CFM_FUNCTION LoadScrap
- ENDIF
-
- ;
- ; pascal SInt32 GetScrap(Handle hDest, ResType theType, SInt32 *offset)
- ;
- IF ¬ GENERATINGCFM THEN
- _GetScrap: OPWORD $A9FD
- ELSE
- IMPORT_CFM_FUNCTION GetScrap
- ENDIF
-
- ;
- ; pascal SInt32 ZeroScrap(void )
- ;
- IF ¬ GENERATINGCFM THEN
- _ZeroScrap: OPWORD $A9FC
- ELSE
- IMPORT_CFM_FUNCTION ZeroScrap
- ENDIF
-
- ;
- ; pascal SInt32 PutScrap(SInt32 length, ResType theType, void *source)
- ;
- IF ¬ GENERATINGCFM THEN
- _PutScrap: OPWORD $A9FE
- ELSE
- IMPORT_CFM_FUNCTION PutScrap
- ENDIF
-
- ENDIF
- ENDIF ; __SCRAP__
-
-